import requests

url = "https://movie.douban.com/j/chart/top_list"
head = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"
}

# 从start 开始 0-100 所有电影数据
for start in range(0, 101, 20):
    # url特别长 -> 重新封装参数
    param = {
        "type": "24",
        "interval_id": "100:90",
        "action": "",
        "start": f"{start}",
        "limit": "20"
    }


    resp = requests.get(url=url, params=param, headers=head)

    print(resp.json())
    print(start)
resp.close()  # 关闭请求, 防止堵塞